<template>
	<view class="all">
		<view class="" v-for="i in list">

			<view class="top-content">
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">文件名称</text>
					</view>
					<text class="item-ipt">{{i.file_name}}</text>
				</view>
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">编制人</text>
					</view>
					<text class="item-ipt">{{i.prepared_by}}</text>
				</view>
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">审核人</text>
					</view>
					<text class="item-ipt">{{i.reviewer}}</text>
				</view>
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">审批人</text>
					</view>
					<text class="item-ipt">{{i.approval}}</text>
				</view>
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">发出部门</text>
					</view>
					<text class="item-ipt">{{i.department_text}}</text>
				</view>
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">日期</text>
					</view>
					<text class="item-ipt">{{i.createtime_text}}</text>
				</view>
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">责任部门/责任人</text>
					</view>
					<text class="item-ipt">{{i.person_text || i.responsible_department_text}}</text>
				</view>
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">完成期限</text>
					</view>
					<text class="item-ipt">{{i.term}}</text>
				</view>
				<view class="content-item">
					<view class="title">
						<text class="point"></text>
						<text class="item-title">提示日期</text>
					</view>
					<text class="item-ipt">{{i.tips_date}}</text>
				</view>
			</view>
			<view class="doc" @tap="downFile(i.file)">
				<image class="docimg" src="../../static/programme1.png" mode=""></image>
				<text class="docTitle">{{i.file_name}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad(e) {
			this.init(e.id)
		},
		methods: {
			init(id) {
				let _this = this
				uni.request({
					url: this.$url + 'relevant.work_plan/getWorkPlanInfoById',
					method: 'GET',
					header: {
						token: uni.getStorageSync('token')
					},
					data: {
						id: id
					},
					success: (res) => {
						if (res.data.code == 1) {
							_this.list = res.data.data
							console.log(_this.list);
						}
					}
				})
			},
			downFile(file){
				this.$downFile(file)
			}
		}
	}
</script>

<style lang="less" scoped>
	.all {
		background: #F1F1F1;
		min-height: 100vh;

		.top-content {
			.content-item {
				display: flex;
				background: #FFFFFF;
				justify-content: space-between;
				border-bottom: 1px solid #DDDDDD;
				padding: 0rpx 32rpx;
				height: 100rpx;
				align-items: center;

				.title {
					display: flex;
					align-items: center;
					width: 150rpx;
					margin-right: 80rpx;

					.point {
						width: 8rpx;
						height: 8rpx;
						background: #003690;
						border-radius: 50%;
						margin-right: 14rpx;
					}

					.item-title {
						font-size: 28rpx;
						font-family: Source Han Sans SC;
						font-weight: 400;
						color: #333333;
					}
				}


				.item-ipt {
					flex: 1;
					font-size: 24rpx;
					font-family: Source Han Sans SC;
					font-weight: 400;
					color: #555555;
				}
			}
		}

		.doc {
			display: flex;
			align-items: center;
			padding: 20rpx 40rpx;
			background: #FFFFFF;
			margin-top: 20rpx;

			.docimg {
				width: 45rpx;
				height: 54rpx;
			}

			.docTitle {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #003690;
				margin-left: 12rpx;
			}
		}
	}
</style>
